<ion-view view-title="商品检索" class="productsearch">
	<!--一定要手动加导航栏-->
	<ion-nav-bar>
		<ion-nav-back-button>
		</ion-nav-back-button>
	</ion-nav-bar>


	<ion-side-menus>
		<ion-side-menu-content drag-content="false">
			<div class="fix-top-bar" style="height: 79px;" ng-style="topObj">
				<div class="item item-input searchbar" ng-if="input.goods_id_search=='' && input.brand_id==0 && input.cat_id==0">
					<i class="icon ion-ios-search placeholder-icon"></i>
					<input class="searchinput" type="text" placeholder="请输入关键字" ng-model="input.keywords">
					<button class="button button-small button-assertive searchbtn" on-tap="do_search()">搜索</button>
				</div>
				<div class="item item-input searchbar" ng-if="input.goods_id_search>0">
					<span class="searchTarget">搜索商品：{{input.goods_name}}</span>
					<!--<button class="button button-small button-assertive searchbtn clear" on-tap="do_clear()">清空搜索条件</button>-->
				</div>
				<div class="item item-input searchbar" ng-if="input.brand_id>0">
					<span class="searchTarget">搜索品牌：{{input.brand_name}}</span>
					<!--<button class="button button-small button-assertive searchbtn clear" on-tap="do_search()">清空搜索条件</button>-->
				</div>
				<div class="item item-input searchbar" ng-if="input.cat_id>0">
					<span class="searchTarget">搜索分类：{{input.cat_name}}</span>
					<!--<button class="button button-small button-assertive searchbtn clear" on-tap="do_search()">清空搜索条件</button>-->
				</div>
				<div class="item item-input row padding-0 go orderBar" style="height: 34px;font-size: 13px;border-right: 0px;">
					<div class="col col-40 padding-0 item-select">
							<div class="input-value ellipsis" ng-click="doSelectSort()" style="width:80%;text-align: center;">{{input.order_select.name}}</div>
					</div>
					<div class="col col-15 padding-0">
						<div class="col text-center" on-tap="sort_xiaol()" ng-class="input.xiaol>-1?'assertive':''">销量
						</div>
					</div>
					<div class="col col-15 padding-0">
						<div class="col text-center" on-tap="sort_price()" ng-class="input.price>-1?'assertive':''">价格
							<i style="margin-top: 1px;" class="icon ion-ios-arrow-up icon-i-my paixu_top " ng-class="{'font-gray-my':input.price==1}"></i>
							<i style="bottom: 2px;" class="icon ion-ios-arrow-down icon-i-my paixu_bottom" ng-class="{'font-gray-my':input.price==0}"></i>
						</div>
					</div>
					<div class="col col-15 padding-0">
						<div class="col text-center">
							<img src="./img/guilin/other/icon_pic.png" on-tap="openShowImg()" ng-if="input.showimg==0" style="width: 16px;display: inline-block;padding-top: 3px;"
							/>
							<img src="./img/guilin/other/icon_list.png" on-tap="openShowImg()" ng-if="input.showimg==1" style="width: 25px;display: inline-block;padding-top: 4px;"
							/>
						</div>
					</div>
					<div class="col col-15 padding-0" ng-if="input.goods_id_search=='' && input.brand_id==0 && input.cat_id==0">
						<div class="col text-center" on-tap="openRightMenu()">筛选
							<img src="./img/guilin/other/icon_filter@2x.png" style="width: 12px;"></img>
						</div>
					</div>
				</div>
			</div>
			<ion-content scroll="false" lazy-scroll style="padding-top: 79px;">
				<ion-scroll delegate-handle="main-handle" direction="y" ng-style="myObj" on-scroll="doShowTop('main-handle',999)" lazy-scroll>
					<!--描述：下拉刷新-->
					<ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
					<div class="font-large-my font-gray-my text-center padding" ng-if="productsearch.length == 0" style="padding-top: 90px;">
						<img src="./img/guilin/other/icon_spw@2x.png" style="width: 133px;height: 110.5px;" />
						<p style="margin-top: 21px;">抱歉，没有找到商品~</p>
					</div>
					<!--列表模式-->
					<div class="list" ng-if="productsearch.length>0&&input.showimg==0">
						<li class="item noborder" ng-repeat="good in productsearch" style="padding: 0px 0px 6px 0px;">
							<div class="row padding-0">
								<div class="col col-33 item-image padding-0" ng-click="onshow_detail(good.goods_id,good.store_id,good.limit)" style="width: 113px; height: 113px;">
									<img style="" src="{{good.image_default_url.s_url}}" />
								</div>
								<div class="col col-67 lstgoodsitem">
									<p class="ellipsis-2" ng-click="onshow_detail(good.goods_id,good.store_id)" style="height: 32px;line-height: 16px;font-size: 13px;color: rgb(5,27,40);">
										{{good.name}}
									</p>
									<div>
										<!-- 价格显示 买家版/卖家版 -->
										<p style="font-size: 13px;margin-top: 20px;" ng-if="good.mktprice!=good.price&&user_type != 5">
											<span style="color: #999999;text-decoration: line-through;">{{good.mktprice|currency:"¥"}}</span>
											<span class="font-middle-my" ng-if="isShowPrice=='true'">[市场价]</span>
										</p>
										<p style="font-size: 16px;color: rgb(254, 97, 25);margin-top: 10px;" ng-click="onshow_detail(good.goods_id,good.store_id)">
											<span class="left-zhang">{{good.price|currency:"¥"}}</span>
											<span class="left-zhang" ng-if="user_type != 5&&isShowPrice=='true'">
												<span class="font-middle-my" ng-if="good.store_type==1">[好友价]</span>
												<span class="font-middle-my" ng-if="good.store_type==2">[供应价]</span>
												<span class="font-middle-my" ng-if="good.store_type!=1 && good.store_type!=2">[商城价]</span>
											</span>
											<span class="left-zhang font-gray-my" style="padding-left: 11px;font-size: 10px;">
												<span ng-if="input.product_display_rate==2">成交：</span>
												<span ng-if="input.product_display_rate==1" class="assertive" style="color: rgb(102,102,102);">{{good.view_count}}人浏览</span>
												<span ng-if="input.product_display_rate==2" class="assertive">{{good.buy_m_count}}</span>
											</span>
										</p>
										<!-- 门店和请联系只能显示一个 -->
										<p ng-click="onshow_store(good.store_id)" style="height: 16px;margin-top: 7px;" ng-if="good.concact==null">
											<img src="./img/guilin/other/shop_icon.png" class="left-zhang" style="width: 15px;" />
											<span class="font-gray-my left-zhang">&nbsp;{{good.store_name}}
												<i class="icon ion-ios-arrow-right" style="font-size: 11px;padding-left: 5px;"></i>
											</span>
										</p>
										<!-- 门店和请联系只能显示一个 -->
										<p class="ellipsis-2" ng-click="onshow_detail(good.goods_id,good.store_id)" style="height: 32px;line-height: 16px;font-size: 11px;"
										 ng-if="good.concact!=null">
											请联系：{{good.concact}}
										</p>
										<!--店铺类型，星级-->
										<div class="level" style="margin-top: 7px;height: 22px;" ng-click="onshow_store(good.store_id)" ng-if="good.concact==null">
											<span class="left-zhang jmd" style="margin-right:5px;" ng-if="good.store_type==1">好友</span>
											<span class="left-zhang jmd">{{good.gradename}}</span>
											<div class="shop_grade grade{{good.level_type}}-{{good.level_star}}"></div>
											<!--星级-->
										</div>
										<div class="clearfix"></div>
									</div>
								</div>
							</div>
						</li>
					</div>
					<!--图片模式-->
					<div class="list goods" ng-if="productsearch.length>0&&input.showimg==1" style="background-color: rgba(0,0,0,0);">
						<div class="body" ng-repeat="good in productsearch" ng-class="$index%2==0?'left':'right'" style="padding: 0px;">
							<div class="body-content item-image" style="background-color: rgb(231,231,231);text-align: left;" ng-class="$index%2==0?'imgpadding_l':'imgpadding_r'">
								<img class="image" src="{{good.image_default_url.s_url}}" ng-click="onshow_detail(good.goods_id,good.store_id)">
								<div style="background-color: white;padding: 10px 10px;border-bottom: 10px solid rgb(231,231,231);">
									<div class="ellipsis-2" style="height: 32px;line-height: 16px;font-size: 13px;margin-bottom: 15px;color: rgb(5,27,40);">{{good.name}}</div>
									<!-- 价格显示 买家版/卖家版 -->
									<p style="font-size: 13px" ng-if="good.mktprice!=good.price&&user_type != 5">
										<span style="color: #999999;text-decoration: line-through;">{{good.mktprice|currency:"¥"}}</span>
										<span style="font-size: 12px;" ng-if="isShowPrice=='true'">[市场价]</span>
									</p>
									<p style="font-size: 16px;">
										<span style="color: rgb(254, 97, 25);">{{good.price|currency:"¥"}}</span>
										<span ng-if="user_type != 5&&isShowPrice=='true'">
											<span class="font-middle-my" ng-if="good.store_type==1">[友好价]</span>
											<span class="font-middle-my" ng-if="good.store_type==2">[供应价]</span>
											<span class="font-middle-my" ng-if="good.store_type!=1 && good.store_type!=2">[商城价]</span>
										</span>
										<span style="font-size: 10px;color: rgb(102,102,102);padding-left: 11px;">{{good.buy_m_count}}人成交</span>
									</p>
									<!-- 门店和请联系只能显示一个 -->
									<p ng-click="onshow_store(good.store_id)" style="height: 16px;margin-top: 10px;" ng-if="good.concact==null">
										<img src="./img/guilin/other/shop_icon.png" class="left-zhang" style="width: 15px;" />
										<span class="left-zhang" style="font-size: 11px;color: rgb(102,102,102);padding-left: 3px;">&nbsp;{{good.store_name}}
											<i class="icon ion-ios-arrow-right" style="padding-left: 5px;"></i>
										</span>
									</p>
									<div class="clearfix"></div>
									<div class="level" ng-click="onshow_store(good.store_id)" ng-if="good.concact==null" style="margin-top: 7px;">
										<span class="left-zhang jmd" style="margin-right:5px;" ng-if="good.store_type==1">好友</span>
										<span class="left-zhang jmd">{{good.gradename}}</span>
										<div class="shop_grade grade{{good.level_type}}-{{good.level_star}}" style="width: 60%;"></div>
										<!--星级-->
									</div>
									<div class="clearfix"></div>
									<!-- 门店和请联系只能显示一个 -->
									<p class="ellipsis-2" ng-click="onshow_detail(good.goods_id,good.store_id)" style="height: 32px;line-height: 16px;font-size: 11px;"
									 ng-if="good.concact!=null">
										请联系：{{good.concact}}
									</p>
								</div>
							</div>
						</div>
					</div>
					<!--描述：当用户到达页脚或页脚附近时-->
					<ion-infinite-scroll ng-if="!isLoad&&page.tPage>page.cPage" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
				</ion-scroll>
				<!--描述：回到顶部-->
				<div class="scroll-to-top" ng-class="showtop999" ng-click="doScrollToTop('main-handle',999)">
					<span class="icon ion-chevron-up"></span>
				</div>
			</ion-content>
		</ion-side-menu-content>

		<ion-side-menu side="right">
			<!--<ion-content class="has-header">-->
			<div class="list" style="padding-top: 45px;">
				<div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
					<div class="input-label">品牌</div>
					<div class="input-value" ng-click="doSelectBrand()">{{input.brand.name}}</div>
				</div>
				<div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
					<div class="input-label">大分类</div>
					<div class="input-value" ng-click="doSelectCat1()">{{input.cat1.name}}</div>
				</div>
				<div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
					<div class="input-label">中分类</div>
					<div class="input-value" ng-click="doSelectCat2()">{{input.cat2.name}}</div>
				</div>
				<div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
					<div class="input-label">小分类</div>
					<div class="input-value" ng-click="doSelectCat3()">{{input.cat3.name}}</div>
				</div>

			</div>
			<div class="row padding-0" style="position: absolute;bottom: 0;">
				<div class="col baseBtn" on-tap="openRightMenu()">取消</div>
				<div class="col baseBtn orange" on-tap="do_search()">确定</div>
			</div>
			<!--</ion-content>-->
		</ion-side-menu>
	</ion-side-menus>
</ion-view>